package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.bean.QzdBean;
import flc.ast.R;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;

public class QzdAdapter extends StkProviderMultiAdapter<QzdBean> {


    public QzdAdapter() {
        addItemProvider(new QzdProvider());
    }

    private class QzdProvider extends BaseItemProvider<QzdBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_qzd;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, QzdBean bean) {
            baseViewHolder.setText(R.id.tvQzdItem,bean.getStr());
            if (bean.isSelect()) {
                baseViewHolder.setImageResource(R.id.ivQzdSelect, R.drawable.xz1);
            } else {
                baseViewHolder.setImageResource(R.id.ivQzdSelect, R.drawable.wxz1);
            }
        }
    }

}
